﻿using System;
using System.Linq;
using System.Linq.Expressions;

namespace DosTexPrj.Core.RepositoriesInterface
{
    public interface IRepository
    {
        TEntity FindByKey<TEntity>(object key) where TEntity : class;

        IQueryable<TEntity> GetAll<TEntity>() where TEntity : class;

        IQueryable<TEntity> FindByCondition<TEntity>(Expression<Func<TEntity, bool>> predicate) where TEntity : class;

        TEntity Save<TEntity>(TEntity entity) where TEntity : class;

        void Delete<TEntity>(Expression<Func<TEntity, bool>> predicate) where TEntity : class;
    }
}